package com.example.basiclib.application;

import android.app.Activity;
import android.app.Application;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Keep;
import android.support.annotation.RequiresApi;

import com.gyf.barlibrary.ImmersionBar;

import timber.log.Timber;

@Keep
public class ActivityLifecycleCallbacksImpl implements Application.ActivityLifecycleCallbacks {
    private ImmersionBar mImmersionBar;


    @Override
    public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
        Timber.tag("xcar").d("%s - onActivityCreated", activity);
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    public void onActivityStarted(Activity activity) {
//        Timber.tag("xcar").e(activity + " - onActivityStarted");
    }

    @Override
    public void onActivityResumed(Activity activity) {
        Timber.tag("xcar").d(activity + " - onActivityResumed");
  /*      View view = activity.findViewById(R.id.top_view);
            if (view != null) {
                mImmersionBar = ImmersionBar.with(activity);
                mImmersionBar.init();
                mImmersionBar
                        .statusBarView(view)
                        .statusBarDarkFont(true, 0.2f)
                        .init();
            }*/
    }

    @Override
    public void onActivityPaused(Activity activity) {
//        Timber.tag("xcar").e(activity + " - onActivityPaused");
    }

    @Override
    public void onActivityStopped(Activity activity) {
//        Timber.tag("xcar").e(activity + " - onActivityStopped");
    }

    @Override
    public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
//        Timber.e(activity + " - onActivitySaveInstanceState");
    }

    @Override
    public void onActivityDestroyed(Activity activity) {
//        Timber.e(activity + " - onActivityDestroyed");
    }
}
